<%@ page language="java" import="java.util.*,java.sql.*" pageEncoding="UTF-8"%>
<%
  Connection con=null;
  int id=Integer.valueOf(request.getParameter("id"));
  try{
  Class.forName("com.mysql.jdbc.Driver");
  String url="jdbc:mysql://localhost:3306/test";
  String username="root";
  String password="root";
  con=DriverManager.getConnection(url, username, password);
  String sql="delete from users where id=?";

  PreparedStatement ps=con.prepareStatement(sql);
  ps.setInt(1, id);
  ps.executeUpdate();
  ps.close(); con.close();
  response.sendRedirect("yhlb.jsp");
  }catch(ClassNotFoundException e){e.printStackTrace();}catch(SQLException e){e.printStackTrace();}
%>
